__author__ = 'East'

salary = int(input('please input your salary: '))
info = [[0, 'car', 100], [1, 'book', 200], [2, 'water', 150]]
cart = []
while True:
    for w in info:
        print(w)
    buy = input('please input buy: ')
    if buy == 'q':
        break
    else:
        buy = int(buy)
    if info[buy][2] > salary:
        print('you have no money...')
        continue
    else:
        salary -= info[buy][2]
        cart.append(info[buy][1])
print(cart)
